package com.x.erp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CompanyDao;
import com.x.erp.model.Company;
import com.x.erp.rpc.CompanyRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;

@Component
@Service(interfaceName = "com.x.erp.rpc.CompanyRpcService", timeout = 60000)
public class CompanyService extends BaseService implements CompanyRpcService {

	@Autowired
	private CompanyDao companyDao;

	@Override
	public List<Company> selectCompanyList(Company company) {
		try {
			return companyDao.selectCompanyList(company);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
}